package crp.core.portal.app;

import crp.core.portal.domain.services.NewsArticleEditor;
import crp.core.portal.domain.services.NewsArticleSearcher;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Instance;
import javax.inject.Inject;

@ApplicationScoped
public class NewsService {
    private final Instance<NewsArticleEditor> articleEditors;
    private final Instance<NewsArticleSearcher> articleSearchers;

    @Inject
    public NewsService(Instance<NewsArticleEditor> articleEditors,
                       Instance<NewsArticleSearcher> articleSearchers) {
        this.articleEditors = articleEditors;
        this.articleSearchers = articleSearchers;
    }

    public NewsArticleEditor articleEditor() {
        return articleEditors.get();
    }

    public NewsArticleSearcher articleSearcher() {
        return articleSearchers.get();
    }
}
